const {
  mrjAsyncBaseReq, //  基本请求
  BaseRequestModel, // 基本请求对象
} = require('./mrhhttp')
const CommonHttp = {
  /**
   * 微信登录获取code
   * @param {参数} param 
   * @param {*} method 
   */
  mrjAsyncWXLogin: (param = {}, method = 'POST') => {
    return new Promise((reslove, reject) => {
      var start = new Date().getTime();
      wx.login({
        success: (res) => {
          var end = new Date().getTime();
          console.log('wx.login()' + "耗时:" + (end - start) + 'ms');
          reslove && reslove(res)
        },
        fail: (err) => {
          var end = new Date().getTime();
          console.log('wx.login()' + "耗时:" + (end - start) + 'ms');
          reject && reject(err);
        }
      })
    })
  }
}